package com.xzl.time.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xzl.time.pojo.vo.AdminVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("评论")
@TableName("t_comment")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class Comment implements Serializable {
    @ApiModelProperty("id")
    private String id;
    @ApiModelProperty("文章id")
    private String articleId;
    @ApiModelProperty("内容")
    private String content;
    @ApiModelProperty("用户id")
    private String userId;
    @ApiModelProperty("父id")
    private String parentId;
    @ApiModelProperty("品论时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp publishDate;
    @ApiModelProperty("点赞数")
    private Integer thumbup;
    @ApiModelProperty("顶级评论id")
    private String ceilingCommentId;

    @TableField(exist = false)
    @ApiModelProperty(value = "评论用户")
    private AdminVo adminVo;

    @TableField(exist = false)
    @ApiModelProperty(value = "被评论的用户")
    private AdminVo toAdminVo;

    @TableField(exist = false)
    @ApiModelProperty(value = "子评论")
    private List<Comment> comments;

}